#ifndef ALGEBRAICOPERATIONDIALOG_H
#define ALGEBRAICOPERATIONDIALOG_H

#include "AbstractDialog.h"
#include "ui_AlgebraicOperationDialog.h"
#include "AlgebraicOperation.hpp"
#include "ImageInfo.h"
#include "Ptr.hpp"

using namespace OOPUtils;


class AlgebraicOperationDialog : public AbstractDialog
{

    Q_OBJECT

private:

    Ui::AlgebraicOperationDialog ui;
    Ptr< QImage > _pSecondImage;
    Ptr< QImage > _pPreviewImage;
    Ptr< AlgebraicOperation > _pAlgebraic;
    
    bool _hasImageLoaded;
    QRect _previewRegion;

    void _doOperation (Ptr< AlgebraicOperation > pAlgebraic = NULL);
    virtual void closeEvent (QCloseEvent * e);
    virtual void showEvent (QShowEvent * e);
    virtual void resizeEvent (QResizeEvent * e);
    virtual void initialize ();

public:

    AlgebraicOperationDialog (QWidget *parent = 0);
    ~AlgebraicOperationDialog ();

public slots:

  void chooseImage ();
  void setToNormal (bool isChecked);
  void setToSum (bool isChecked);
  void setToDifference (bool isChecked);
  void setToProduction (bool isChecked);
  void setToQuotient (bool isChecked);

};

#endif // ALGEBRAICOPERATIONDIALOG_H
